
/* DEBUG */

/**
 * 
 * - debug() function call
 * 
 * 
 */

var debugEl;

function debug(message)
{
	if (debugEnabled) {
		if (!debugEl) {
			debugEl = document.createElement('p');
			debugEl.innerHTML = 'DEBUG MESSAGES';
			document.getElementById('bodyContent').appendChild(debugEl);
		}
		if (console && typeof console.log == 'function') {
			console.log(message);
		}
		debugEl.appendChild(document.createElement('br'));
		debugEl.appendChild(document.createTextNode(new Date().toTimeString().split(' ')[0]+" "+ message));
	}
}

var debugEnabled = true;
